<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button >点我</button>

    <script>
        //获取元素
        let btn = document.querySelector('button');

        let a = fn();

        btn.onclick = a;

        function fn(){
            console.log(this);
            return 123;
        }

        // let obj = {
        //     fn: function(){
        //         console.log(this);
        //     }
        // }

        // btn.onclick = function(e) {
        //     // console.log(this); 
        //     console.log(e.target);

        // }

        // btn.addEventListener('click', function(){})


    </script>
</body>
</html>